﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;

namespace Dark_Core_Library.DatabaseModules.MongoDB
{
    /// <summary>
    /// 文档基类单元
    /// </summary>
    public class DocumentUnit
    {

        /// <summary>
        /// 唯一标识符ID
        /// </summary>
        [BsonId]
        [BsonRepresentation(BsonType.ObjectId)]
        public ObjectId id { set; get; }


        /// <summary>
        /// 文档创建时间
        /// </summary>
        [BsonElement("createTime")]
        [BsonRepresentation(BsonType.DateTime)]
        public DateTime CreateTime { set; get; }

        public DocumentUnit()
        {
            id = ObjectId.GenerateNewId();
            CreateTime = DateTime.Now;
        }
    }
}
